<template>
  <div class="header">
    <el-row>
      <el-col :span="8" :offset="4">欢迎来到在线集市交易平台</el-col>
      <el-col :span="5" :offset="6">
        <div class="lore">
          <el-link :underline="false" href="/">首页</el-link>|
          <el-link :underline="false" @click="gotoLogin('login')">登录</el-link>|
          <el-link :underline="false" @click="gotoLogin('register')">注册</el-link>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  methods: {
    gotoLogin(pageItem) {
      this.$router.push({path: "/login",query:{ name:pageItem}});
    }
  }
}
</script>

<style scoped="scoped">
a {
  text-decoration: none;
}

/* 基础样式 */
.header {
  height: 60px;
  width: 100%;
  line-height: 60px;
  color: #606266;
  font-size: 14px;
  background-color: #ffffff;
  border-bottom: 1px solid #ebeef5;
  position: fixed;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.header a {
  transition: all 0.3s;
}

.header a:hover {
  color: #409EFF;
}

.lore {
  color: #909399;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.lore .el-link {
  margin: 0 15px;
  color: #606266;
  font-size: 14px;
  transition: all 0.3s;
}

.lore .el-link:hover {
  color: #409EFF;
}

/* 大屏幕 (≥1200px) */
@media (min-width: 1200px) {
  .header .el-row {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* 中等屏幕 (≥992px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .header .el-row {
    padding: 0 20px;
  }
}

/* 平板 (≥768px) */
@media (max-width: 991px) and (min-width: 768px) {
  .header .el-row {
    padding: 0 15px;
  }
  
  .lore .el-link {
    margin: 0 10px;
  }
}

/* 手机 (<768px) */
@media (max-width: 767px) {
  .header {
    height: auto;
    padding: 10px 0;
  }

  .header .el-row {
    padding: 0 10px;
  }
  
  .el-row .el-col {
    width: 100% !important;
    margin: 0 !important;
    text-align: center;
  }

  .lore {
    justify-content: center;
    margin-top: 10px;
  }
  
  .lore .el-link {
    margin: 0 8px;
    font-size: 13px;
  }
}

/* 超小屏幕 (<480px) */
@media (max-width: 479px) {
  .header {
    padding: 8px 0;
  }

  .lore .el-link {
    margin: 0 6px;
    font-size: 12px;
  }
}
</style>
